<?php
class Zend_View_Helper_ShowBannerIndex {
    public function showBannerIndex($view) {

    	$banner = $view->Banner;
    	$str='';
        $str .= '<a href="'.$view->url(array('controller'=>'banner', 'action'=>'add')).'">Thêm banner mới</a>';
        $str .= '<table id="product-table" border="0" cellpadding="0" cellspacing="0" width="100%">';
		$str .= '<tr>';
		
    	$str .= '<th class="table-header-repeat line-left minwidth-1"><a href="">Id</a></th>';
		$str .= '<th class="table-header-repeat line-left minwidth-1"><a href="">Tên</a></th>';
		$str .= '<th class="table-header-repeat line-left minwidth-1"><a href="">Mã</a></th>';
		$str .= '<th class="table-header-repeat line-left minwidth-1"><a href="">Text</a></th>';
		$str .= '<th class="table-header-repeat line-left minwidth-1"><a href="">Click URL</a></th>';
		$str .= '<th class="table-header-repeat line-left minwidth-1"><a href="">Định dạng</a></th>';	
		$str .= '<th class="table-header-repeat line-left minwidth-1"><a href="">Trạng thái</a></th>';
		$str .= '<th class="table-header-repeat line-left minwidth-2"><a href="">Thao tác</a></th>';
		
		$str .= '</tr>';

        
        foreach ($banner as $banner) {
        	$str .= '<tr>'; 	
            $str .='<td>'.$banner->banner_id.'</td>';
			$str .='<td>'.$banner->name.'</td>';
			$str .='<td>'.$banner->code.'</td>';
			$str .='<td>'.$banner->text.'</td>';
			$str .='<td>'.$banner->click_url.'</td>';
			$str .='<td>'.$banner->format.'</td>';
			$str .='<td>'.$banner->status.'</td>';
			$str .= '<td class="options-width"><a class="icon-1 info-tooltip" href="'.$view->url(array('controller'=>'banner', 'action'=>'edit', 'banner_id'=>$banner->banner_id)).'" title="Sửa"></a> ';
			$str .= '<a title="Thêm" class="icon-3 info-tooltip" href="'.$view->url(array('controller'=>'banner', 'action'=>'add','banner_id'=>$banner->banner_id)).'"></a>';
            $str .= '<a class="icon-2 info-tooltip" href="'.$view->url(array('controller'=>'banner', 'action'=>'delete','banner_id'=>$banner->banner_id)).'" title="Xóa"></a></td>';       
            $str .='</tr>';
        }
        
        $str .= '</table>';
        
        return $str; 

    }
}